#ifndef WIJIRPC_H
#define WIJIRPC_H
#include "wijiuiscriptable.h"
#include <QtNetwork>
#include <QStringList>
#include <QTcpServer>
#include <QTcpSocket>
class WijiRPC : private QThread
{
Q_OBJECT
    virtual void run();
public:
    WijiRPC();
public slots:
    void init();
    void begin();
    void acceptConnection();
    void displayError(QAbstractSocket::SocketError socketError);
    void read();
    void sendResult(QString result);
    void processRequest(QVariantMap request);
private:
    QTcpServer tcpServer;
    QTcpSocket tcpClient;
    QTcpSocket *tcpServerConnection;
    int bytesToWrite;
    int bytesWritten;
    int bytesReceived;
};

#endif // WIJIRPC_H
